package newsSystem.newscate;

import newsSystem.dao.NewsCategoryJDBC;

import java.util.List;

public class NewsCatePage {
    private static List<NewsCateInfo>NewsCateList;
    public static void main(String[] args) {
//        调用AdminJDBC方法
        NewsCategoryJDBC.newscate();
//        调用AdminManager的get来测试添加函数,获取管理员数据
        getNewsCateInfo();

    }
    public static void getNewsCateInfo(){
        NewsCateList= NewsCateManager.getNewsCateList();
        // 遍历管理员集合
        for (NewsCateInfo newscate : NewsCateList) {
            System.out.println("编号: " + newscate.getNewsCNo() + ", 名称: " + newscate.getNewsCName());
        }

    }

    // 通过构造函数传递 adminList
    public NewsCatePage(List<NewsCateInfo> NewsCateList) {
        this.NewsCateList = NewsCateList;
    }

    // 或者通过方法传递 adminList
    public void setNewsCateInfo(List<NewsCateInfo> NewsCateList) {
        this.NewsCateList = NewsCateList;
    }
}
